<div class="modal-dialog modal-md">
  <div class="modal-content">
    <div class="modal-header">
      <h3 class="modal-title">{{title}}</h3>
    </div>
    <div class="modal-body">
      <div class="image-preview">
        <img *ngIf="previewImg" [src]="previewImg" class="img-fluid" alt="image-preview">
        <i *ngIf="!previewImg" class="fa fa-image"></i>
      </div>
      <button class="btn btn-secondary btn-lg" (click)="inputFile.click()">
        选择图片
        <input #inputFile type="file" class="form-control form-control-lg" accept="image/png,image/gif,image/jpeg" (change)="uploadFile($event)">
      </button>
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-lg btn-info" [disabled]="!previewImg" (click)="confirm($event); dismiss.click();">上传图片</button>
      <button #dismiss type="button" class="btn btn-lg btn-secondary" data-dismiss="modal">取消</button>
    </div>
  </div>
</div>
